#ifndef LOGGER_H
#define LOGGER_H

#include <pthread.h>

#define MAX_READ_BUFFER     256
#define MAX_LOG_LINESIZE     256

#define NO_OF_BYTES_IN_KB   1024	// 1 KB = 1024 bytes

#define MAX_LOG_SIZE        10 * (1024)	// in KB = 10 MB

#define FATAL_ERROR			1	// Fatal Error					
#define FATAL_UNEXP_CASE	        2	// Unexpected Cases - serious		
#define WARNING				3       // Errors not serious				
#define UNEXP_CASE			4	// Unexpected Cases - not serious -	
#define EVENT_STATUS			5	// Status							




class CLogger
{
	int      m_nLogDetails;
	char*    m_szLogFileName;
	pthread_mutex_t    m_mutLog;
	char* m_pszLogBuffer;
	long m_lLogFileMaxLimit;	// Maximum log file limit
	
public:
// Log Functions.
	CLogger();
	void InitLogging(int nDetail, const char* szFileName = NULL, long lLogFileMaxLimit = MAX_LOG_SIZE /*in KB*/);
	void log(int nPriority, const char* szTemplate, ...);
	void EndLogging();
};
		
#endif
